<template>
  <div class="show-title">
    <slot></slot>
    <div class="show-btn" v-if="show" @click="eventChange(false)">
      <span>收起</span>
      <x-icon type="ios-arrow-down" size="18" fill="#fff"></x-icon>
    </div>
    <div class="show-btn" v-else-if="!show" @click="eventChange(true)">
      <span>展开</span>
      <x-icon type="ios-arrow-up" size="18" fill="#fff"></x-icon>
    </div>
  </div>
</template>
<script>
export default {
  name: "chart-title",
  props: {
    show: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    eventChange(val) {
      this.$emit('showChange',val)
    }
  }
};
</script>
<style lang=""></style>
